﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WorkedTime.Cnsl.ProgramEntities.ProgramEnums;
using WorkedTime.Cnsl.Resources;

namespace WorkedTime.Cnsl.ProgramEntities
{
    class ProgramUserInteraction
    {
        public static string AskUserOption()
        {
            System.Console.Clear();
            System.Console.WriteLine(MenuResource.Title, Environment.NewLine);
            foreach(var option in Enum.GetValues(typeof(ProgramOptions)))
            {
                System.Console.WriteLine(MenuResource.ResourceManager.GetString(option.ToString()), (int)option);
            }
            return System.Console.ReadLine();
        }

        public static bool AskUserForEnglishCulture()
        {
            string answer;
            do
            {
                System.Console.WriteLine(
                    string.Format(BaseResource.DoYouSpeakEnglish, YesNo.Yes.ToString(), YesNo.No.ToString()));
                answer = System.Console.ReadLine().ToLower();
            } while (answer != YesNo.Yes.ToString().ToLower() && answer != YesNo.No.ToString().ToLower());
            return answer == YesNo.Yes.ToString().ToLower();
        }

        public static void SayGoodbye()
        {
            Console.WriteLine(BaseResource.Goodbye, Environment.NewLine);
            Console.ReadKey();
        }
    }
}
